<?php
namespace Kuoqi\Curl;
class Tools{
	
	public static $params = array();
	
	final static function arr2datapost($arr,$tips = ''){
        if(!$arr){self::$params = array();return;}
        foreach($arr as $k=>$v){
            if(is_array($v)){
                self::arr2datapost($v,$tips?$tips.'['.$k.']':$k);
            }else{
                self::$params[$tips?$tips.'['.$k.']':$k] = $v;
            }
        }
		return self::$params;
	}
	
	final static function arr2datajava($arr,$tips = ''){
		if(!$arr){self::$params = array();return;}
		foreach($arr as $k=>$v){
			if(is_array($v)){
				self::arr2datajava($v,$tips?($tips.'.'.$k):$k);
			}else{
				self::$params[$tips?($tips.'.'.$k):$k] = $v;
			}	
		}
		return self::$params;	
	}
	
}